{% extends 'header.html' %}
{% block title %}
	主页
{% endblock %}

{% block main %}
    <h1>博客</h1>
    <div class="row row-cols-2 row-gap-sm-2">
        {% for blog in blogs %}
        	<div class="col">
                <div class="card">
                  <div class="card-header">
                      <a class="link-dark" href="{% url 'blog:blog_detail' blog.id %}">{{ blog.title }}</a>
                  </div>
                  <div class="card-body">
                      {{ blog.sub_content | striptags | truncatechars:30}}
                  </div>
                  <div class="card-footer text-body-secondary d-flex justify-content-between">
                      <div>
                          <img width="30px" height="30px" src="{{ blog.icon_url }}" alt="">
                          {{ blog.author__username }}
                      </div>
                      发布时间: {{ blog.pub_time | date:'Y年m月d日 H:i:s' }}
                  </div>
                </div>
            </div>
        {% endfor %}
    </div>
    {% block UD %}
    {% endblock %}
{% endblock %}
